import 'package:flutter/material.dart';

import 'package:junyeyishu/utils/utils.dart';
import 'package:junyeyishu/widgets/QGWidget.dart';

class QGMineNFTCell extends StatefulWidget {
  dynamic data;
  QGMineNFTCell({super.key, this.data});
  @override
  State<QGMineNFTCell> createState() => _QGMineNFTCellState();
}

class _QGMineNFTCellState extends State<QGMineNFTCell> {
  // bool islike = false;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          color:Color(0XFF232A32),
          borderRadius: BorderRadius.circular(10.rpx)),
      child: Stack(
        children: [
          Column(
            children: [
              ClipRRect(
                borderRadius: BorderRadius.circular(10.rpx),
                child: AspectRatio(
                  aspectRatio: 1,
                  child: QGImage(url: widget.data?["thumb_img"]),
                ),
              ),
              buildBottom(),
            ],
          ),
          Positioned(
              right: 0.rpx,
              bottom: 0.rpx,
              child:
                  QGImage(asset: 'minbg',width: 130.rpx)),
          // Positioned(
          //     left: 5.rpx,
          //     top: 5.rpx,
          //     child:
          //         QGImage(url: widget.data?["level_pic_url"], width: 30.rpx)),
        ],
      ),
    );
  }

  buildBottom() {
    return Expanded(
      child: Column(
        children: [
          FittedBox(
            child: Container(
              margin: EdgeInsets.only(top: 10.rpx,bottom: 5.rpx),
              padding: EdgeInsets.symmetric(horizontal: 5.rpx),
              child: Text(
                widget.data?["name"] ?? "",
                style: TextStyle(
                    color: Color(0xFFFFFFFF),
                    fontSize: 14.rpx,
                    fontWeight: FontWeight.bold),
              ),
            ),
          ),
          Text(
            '共${widget.data?["goods_num"]}个，寄售${widget.data?["freezeNum"]}个',
            style: TextStyle(
                color: Color(0xFFFFFFFF),
                fontSize: 10.rpx,
                fontWeight: FontWeight.bold),
          ),
        ],
      ),
    );
  }
}
